/******************************************************************************* * Copyright (c) 2012, Project: FP7-ICT-257930 Aniketos * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * - Neither the name of institution nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ /** */ package eu.aniketos.mtm.srs.impl; import eu.aniketos.mtm.srs.InfoDocType; import eu.aniketos.mtm.srs.PartOfType; import eu.aniketos.mtm.srs.SrsPackage; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.EObjectImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Part Of Type</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link eu.aniketos.mtm.srs.impl.PartOfTypeImpl#getContainer <em>Container</em>}</li> * <li>{@link eu.aniketos.mtm.srs.impl.PartOfTypeImpl#getContent <em>Content</em>}</li> * </ul> * </p> * * @generated */ public class PartOfTypeImpl extends EObjectImpl implements PartOfType { /** * The cached value of the '{@link #getContainer() <em>Container</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getContainer() * @generated * @ordered */ protected InfoDocType container; /** * The cached value of the '{@link #getContent() <em>Content</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getContent() * @generated * @ordered */ protected InfoDocType content; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected PartOfTypeImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return SrsPackage.Literals.PART_OF_TYPE; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public InfoDocType getContainer() { return container; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetContainer(InfoDocType newContainer, NotificationChain msgs) { InfoDocType oldContainer = container; container = newContainer; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SrsPackage.PART_OF_TYPE__CONTAINER, oldContainer, newContainer); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setContainer(InfoDocType newContainer) { if (newContainer != container) { NotificationChain msgs = null; if (container != null) msgs = ((InternalEObject)container).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SrsPackage.PART_OF_TYPE__CONTAINER, null, msgs); if (newContainer != null) msgs = ((InternalEObject)newContainer).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SrsPackage.PART_OF_TYPE__CONTAINER, null, msgs); msgs = basicSetContainer(newContainer, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SrsPackage.PART_OF_TYPE__CONTAINER, newContainer, newContainer)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public InfoDocType getContent() { return content; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetContent(InfoDocType newContent, NotificationChain msgs) { InfoDocType oldContent = content; content = newContent; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SrsPackage.PART_OF_TYPE__CONTENT, oldContent, newContent); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setContent(InfoDocType newContent) { if (newContent != content) { NotificationChain msgs = null; if (content != null) msgs = ((InternalEObject)content).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SrsPackage.PART_OF_TYPE__CONTENT, null, msgs); if (newContent != null) msgs = ((InternalEObject)newContent).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SrsPackage.PART_OF_TYPE__CONTENT, null, msgs); msgs = basicSetContent(newContent, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, SrsPackage.PART_OF_TYPE__CONTENT, newContent, newContent)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case SrsPackage.PART_OF_TYPE__CONTAINER: return basicSetContainer(null, msgs); case SrsPackage.PART_OF_TYPE__CONTENT: return basicSetContent(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case SrsPackage.PART_OF_TYPE__CONTAINER: return getContainer(); case SrsPackage.PART_OF_TYPE__CONTENT: return getContent(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case SrsPackage.PART_OF_TYPE__CONTAINER: setContainer((InfoDocType)newValue); return; case SrsPackage.PART_OF_TYPE__CONTENT: setContent((InfoDocType)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case SrsPackage.PART_OF_TYPE__CONTAINER: setContainer((InfoDocType)null); return; case SrsPackage.PART_OF_TYPE__CONTENT: setContent((InfoDocType)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case SrsPackage.PART_OF_TYPE__CONTAINER: return container != null; case SrsPackage.PART_OF_TYPE__CONTENT: return content != null; } return super.eIsSet(featureID); } } //PartOfTypeImpl